package com.hhkj.study.admin.goods.service.extend.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hhkj.study.admin.goods.entity.Goods;
import com.hhkj.study.admin.goods.model.podo.GoodsDo;
import com.hhkj.study.admin.goods.model.podo.GoodsPo;
import com.hhkj.study.admin.goods.service.base.GoodsService;
import com.hhkj.study.admin.goods.service.extend.GoodsExtendService;
import com.ruoyi.common.base.biz.service.extend.BaseExtendServiceImpl;
import com.ruoyi.common.cont.SysConst;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-18
*/
@Service
public class GoodsExtendServiceImpl extends BaseExtendServiceImpl<Goods, GoodsDo, GoodsPo, GoodsService> implements GoodsExtendService {

    @Override
    public List<GoodsPo> listByIdList(Collection<? extends Serializable> idList) {
        LambdaQueryWrapper<Goods> goodsQuery = new LambdaQueryWrapper<>();
        goodsQuery.in(Goods::getId, idList);
        List<Goods> list = this.getService().list(goodsQuery);
        return BeanUtil.copyToList(list, GoodsPo.class);
    }
}
